home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir44 / dcg303xa.zip / BARTENDE.SCR < prev    next >
Text File  |  1993-06-27  |  5KB  |  203 lines

  1. !
  2. ! Default bartender script..
  3. !
  4. ! (c) DC Software, 1992
  5. !
  6. ! Pending Enhancements
  7. !
  8. ! - This script has no voices.  For an example of voices, look at
  9. !   MERCHANT.SCR and HEALER.SCR
  10. !   
  11.  
  12. !------------------------------------------------------------------------!
  13. :@TALK ! Talk to the character !
  14. !------------------------------------------------------------------------!
  15.  
  16.   if player.hp = 0 then
  17.     writeln( player.name, " is dead!" );
  18.     STOP;
  19.   endif;
  20.  
  21.   if npc.picture >= 0 then
  22.     viewpcx(npc);
  23.   endif;
  24.  
  25. ! First, say hello.. !
  26.   if NPC.V(0) > 0 then
  27.     writeln( "Hello ", player.name, ". What brings you back?" );
  28.   else
  29.     writeln( "Welcome to ", npc.name, ". How may I help you?" );
  30.   endif;
  31.  
  32. ! NowF, set some variables..
  33.   NPC.V(0) = 1;             ! From know on, remember we've been here
  34.   L(1) = 0;                 ! No business transactions have taken place
  35.   L(4) = npc.value / 5 + 1; ! Standard Tip Amount !
  36.  
  37. :LOOP
  38.  
  39.   L(3) = select$( "Buy Drink",  npc.value,
  40.                 "Give Tip",     L4,       ! Can't use X(y) on select !
  41.                 "Talk",         -1 );
  42.  
  43.   ON L(3) GOTO DRINK,TIP,XTALK;
  44.  
  45. :CSTOP
  46.   if L(1) = 0 THEN
  47.     writeln( "Hasta la vista, baby." );
  48.   else
  49.     writeln( "It's been a pleasure doing business with you!" );
  50.   endif;
  51.   goto XSTOP;
  52.  
  53. !
  54. ! Drink
  55. !
  56. :DRINK
  57.  
  58.   if group.gold < npc.value GOTO BROKE;
  59.  
  60.   dec( group.gold, npc.value );
  61.   ON L(1) GOTO DRINK1, DRINK2, DRINK3, DRINK4;
  62.  
  63.   writeln( "No more beer for you.." );
  64.   GOTO LOOP;
  65.  
  66. :DRINK1
  67.   writeln( ">Ahhh.. That really hit the spot.." );
  68.   inc(L1);
  69.   goto LOOP;
  70.  
  71. :DRINK2
  72.   writeln( ">Excellent brew, yes sir.." );
  73.   inc(L1);
  74.   goto LOOP;
  75.  
  76. :DRINK3
  77.   writeln( ">Glugh, glugh, glugh, hic!" );
  78.   inc(L1);
  79.   goto LOOP;
  80.  
  81. :DRINK4
  82.   writeln( ">Glugh, glugh, burp!  Sorry.." );
  83.   inc(L1);
  84.   if random(2) then     ! 50 % chance of getting sick..
  85.     player.poisoned = 1;
  86.     writeln( "(You feel sick..)" );
  87.   endif;
  88.   goto LOOP;
  89.  
  90. !
  91. ! Give TIP
  92. !
  93. :TIP
  94.  
  95.   if group.gold < L(4) GOTO BROKE;
  96.  
  97.   dec( group.gold, L(4) );
  98.  
  99.   ON L(1) GOTO TIP1, TIP2, TIP3, TIP4, TIP5;
  100.  
  101. :TIP1
  102.   writeln( ">Heard any good ones lately?" );
  103.   writeln( "(the bartender ignores you..)" );
  104.   inc( group.gold, L(4) );
  105.   goto LOOP;
  106.  
  107. :TIP2
  108.   writeln( ">It's pretty slow around here.." );
  109.   writeln( "It's the weather.. You'll get used to it.." );
  110.   goto LOOP;
  111.  
  112. :TIP3
  113.   loadhint;   ! Loads a random hint into a string variable !
  114.   writeln( S0 );
  115.   goto LOOP;
  116.  
  117. :TIP4
  118.   writeln( ">Heard any good.. Hic!.." );
  119.   writeln( "You're drunk.. You should leave now." );
  120.   goto LOOP;
  121.  
  122. :TIP5
  123.   writeln( ">Hic! 'scuse me.. Hic! Burp!" );
  124.   writeln( "No drunks allowed on the premises.." );
  125.   goto XSTOP;
  126.  
  127. :BROKE
  128.   writeln( "You don't have enough money!");
  129.   goto LOOP;
  130.  
  131. !
  132. ! Conversation
  133. !
  134. :XTALK
  135.   on L(1) GOTO TALK1, TALK2, CHAT;
  136.  
  137.   writeln( ">Hic! Hic! Burp! 'Scuse me.. Hic!" );
  138.   writeln( "You'd better watch your drinking buddy.." );
  139.   goto LOOP;
  140.  
  141. :TALK1
  142.   writeln( "Does this look like a social club?" );
  143.   goto LOOP;
  144.  
  145. :TALK2
  146.   writeln( "I'm busy.  Ask me again later.." );
  147.   goto LOOP;
  148.  
  149. :CHAT
  150.   writeln( "What would you like to talk about?" );
  151.  
  152. :CHAT1
  153.   L(3) = getstr("Name","Beer","Tip","Job","Bye");
  154.   if L(3) = -1 then 
  155.     writeln( "Ok." );
  156.     goto LOOP; ! Pressed ESCape !
  157.   endif;
  158.  
  159. ! First, see if the keyword typed is in the character's text block !
  160.   if dotext( S0 ) then
  161.     if L(3) = 4 goto XSTOP;
  162.     goto CHAT1;
  163.   endif;
  164.  
  165. ! It didn't, so try the predefined ones..
  166.   on L(3) goto CNAME, CBEER, CTIP, CJOB, CSTOP;
  167.  
  168. !-----------------------------------------------------------------!
  169. ! All STOPs now lead here so the screen can be restored if needed !
  170. !-----------------------------------------------------------------!
  171. :XSTOP
  172.   if npc.picture >= 0 then
  173.     paint(window); ! Assumes the picture fits in the window !
  174.   endif;
  175.   STOP;
  176.  
  177.  
  178. ! Nope, try a 'DEFAULT' line
  179.   if not dotext( "DEFAULT" ) then
  180.     ! didn't have 'default' in the text block, so give standard default !
  181.     writeln( "I don't know anything about that!" );
  182.   endif;
  183.   goto CHAT1;
  184.  
  185. :CNAME
  186.    writeln( "My name is ", NPC.name, "." );
  187.    GOTO CHAT1;
  188.  
  189. :CBEER
  190.    writeln( "A beer sells for ", $npc.value, " the pretzels are free." );
  191.    GOTO CHAT1;
  192.  
  193. :CTIP
  194.    writeln( "Most people give ", $L4 );
  195.    GOTO CHAT1;
  196.  
  197. :CJOB
  198.    writeln( "I sell {beer}!" );
  199.    GOTO CHAT1;
  200.  
  201. ! Feel free to expand on this list.. !
  202.  
  203.